package com.fan.springboot.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fan.springboot.dao.NewsDao;
import com.fan.springboot.domain.News;

@Service
public class NewsService {

	@Autowired
	private NewsDao newsDao;

	public void save(News news) {
		newsDao.save(news);
	}

	public void delete(String id) {
		newsDao.delete(id);
	}

	public void update(News news) {
		newsDao.update(news);
	}

	public Object findAllbyDESC(int currentPage, int limitNumber) {
		return newsDao.findAllbyDESC(currentPage, limitNumber);
	}

	public News getNewsById(String id) {
		return newsDao.getNewsById(id);
	}

}
